#include <bits/stdc++.h>
#define ll long long
using namespace std;

const ll inf=1e15;
const int Maxn=3e5+7,V=2e5+5;
int n;
struct node{
    int a,h;
}a[Maxn];
ll f[Maxn],sm[Maxn];

inline ll cup(int x,int y){
    return x/y+(x%y!=0)-1;
}
int L[Maxn],R[Maxn],bl;
ll smn[Maxn],qp[Maxn],suf[Maxn],pre[Maxn];
int pos[Maxn];

inline void modify(int x,ll v){
    int qx=pos[x];
    qp[x]=min(qp[x],v);
    smn[qx]=min(smn[qx],v);
    suf[x]=min(suf[x],v);
    pre[x]=min(pre[x],v);
    for(int i=x+1;i<=R[qx];i++){
        pre[i]=min(pre[i],pre[i-1]);
    }
    for(int i=x-1;i>=L[qx];i--){
        suf[i]=min(suf[i+1],suf[i]);
    }
}
inline ll query(int l,int r){
    int ql=pos[l],qr=pos[r];ll ret=inf;
    if(ql==qr){
        for(int i=l;i<=r;i++) ret=min(ret,qp[i]);
        return ret;
    }
    for(int i=ql+1;i<qr;i++) ret=min(ret,smn[i]);
    ret=min(ret,min(suf[l],pre[r]));
    return ret;
}

int main(){
    freopen("xinyue.in","r",stdin);
    freopen("xinyue.out","w",stdout);

    scanf("%d%d",&n,&a[0].a);
    for(int i=1;i<=n;i++) scanf("%d%d",&a[i].a,&a[i].h);
    sort(a+1,a+n+1,[](node x,node y){
        return x.a<y.a;
    });
    int mx=a[n].a;
    for(int i=1;i<=n;i++) sm[i]=sm[i-1]+cup(a[i].h,mx)*a[i].a;

    bl=sqrt(V);
    for(int i=1;i<=bl;i++){
        L[i]=R[i-1]+1;
        R[i]=i*bl;
    }
    if(R[bl]<V) R[++bl]=V,L[bl]=R[bl-1]+1;
    for(int i=1;i<=bl;i++) smn[i]=inf;
    for(int i=1;i<=bl;i++)
        for(int j=L[i];j<=R[i];j++)
            pos[j]=i,qp[j]=inf,suf[j]=pre[j]=inf;

    modify(a[0].a,0);
    for(int i=1;i<=n;i++){
        int v=a[i].h;
        f[i]=inf;
        int sq=sqrt(v)+2;
        for(int l=1,r;l<=v;l=r+1){
            r=v/(v/l);
            f[i]=min(f[i],query(l,r)+1ll*(v/l)*a[i].a);
        }
        for(int j=1;j<=sq;j++){
            if(!(v%j)){
                f[i]=min(f[i],qp[j]+cup(v,j)*a[i].a);
                f[i]=min(f[i],qp[v/j]+cup(v,v/j)*a[i].a);
            }
        }
        f[i]=min(f[i],query(v,V));
        f[i]=f[i]+sm[i-1];
        modify(a[i].a,f[i]-sm[i]);
        
    }
    printf("%lld",f[n]);

    // system("pause");
    return 0;
}
/*
4 1
3 2
4 4
5 6
1 6
*/